# 1:有效性判断
# 2.计算时分秒之和
# 3.转化为秒
# 4.再过18888秒后是多少



import datetime


def check(hour, minite, second):
    try:
        datetime.time(hour, minite, second)
        return True
    except:
        return False

def cal_puls(hour, minite, second):
    return int(hour) + int(minite) + int(second)

def cal_time(hour, minite, second):
    return (int(hour) * 60 + int(minite)) * 60 + int(second)

def cal_after(hour, minite, second):
    input_time = datetime.datetime(1,1,1,hour, minite, second)
    result = input_time + datetime.timedelta(seconds=18888)
    return result.time()


def main():
    try:
        hour, minite, second = map(int,input("输入时分秒（如12:12:12）：").split(":"))
        check(hour, minite, second)
        a = cal_puls(hour, minite, second)
        print(a)
        b = cal_time(hour, minite, second)
        print(b)
        c = cal_after(hour, minite, second)
        print(c)
    except:
        print("错误")

main()